package com.db.priceApp.network.protocol;

import java.nio.channels.SelectionKey;


public class Message {
	private MessageType messgType;
	private String instrName;
	private float price;
	private String text;
	private long time;
	private SelectionKey key;
	private String login;
	
	public Message(SelectionKey key, String login) {
		this.setKey(key);
		this.login = login;
	}
	public Message() {
		this(null, null);
	}
	public MessageType getMessageType() {
		return messgType;
	}
	public void setMessageType(MessageType messgType) {
		this.messgType = messgType;
	}
	public String getInstrumentName() {
		return instrName;
	}
	public void setInstrumentName(String instrName) {
		this.instrName = instrName;
	}
	public float getPrice() {
		return price;
	}
	public void setPrice(float price) {
		this.price = price;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public long getTime() {
		return time;
	}
	public void setTime(long time) {
		this.time = time;
	}
	public SelectionKey getKey() {
		return key;
	}
	public void setKey(SelectionKey key) {
		this.key = key;
	}
	
	public String getLogin() {
		return login;
	}
	public void setLogin(String login) {
		this.login = login;
	}

	@Override
	public String toString() {
		return "MType=" + messgType + ", login=" + login + ", instrName=" + instrName
				+ ", price=" + price + ", text=" + text + ", time=" + time;
	}
}
